<link href="../addons/jy_merch3fee/css/style.css" rel="stylesheet">

<style>
    .fui-list-group{
        background: transparent;
    }
    .fui-list{
        background: #fff;
    }
    .fui-list:first-child{
        margin-top: 0rem;
    }
    .fui-list.particulars{
        height: 3rem;
        padding:.4rem 0;
    }
    .fui-list.particulars div{
        -webkit-box-flex: 1;
        -webkit-flex: 1;
        -ms-flex: 1;
        flex: 1;
        text-align: center;
        font-size: .55rem;
        border-right: 1px solid #ededed;
        color: #000;
    }
    .fui-list.particulars div:last-child{border: 0}
</style>
<div class="fui-page fui-page-current page-commission-log">
    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back" ng-click='goback()'></a>
        </div>
        <div class="title">代理地区({{pagedata.area_total}})</div>
    </div>
    <div class="fui-content navbar">

 <div class="fui-tab fui-tab-warning" id="tab">
            <a href="javascript:;" ng-class="{'active':pagedata.params.status==undefined}" ng-click="pagedata.list=[];pagedata.loaded=false;pagedata.params.page=1;pagedata.params.status=undefined;pagedata.get_list()">全部</a>
			<a href="javascript:;" ng-class="{'active':pagedata.params.status==0}" ng-click="pagedata.list=[];pagedata.loaded=false;pagedata.params.page=1;pagedata.params.status=0;pagedata.get_list()">待审核</a>
            <a href="javascript:;" ng-class="{'active':pagedata.params.status==1}" ng-click="pagedata.list=[];pagedata.loaded=false;pagedata.params.page=1;pagedata.params.status=1;pagedata.get_list()">已审核</a>
            <a href="javascript:;" ng-class="{'active':pagedata.params.status==2}" ng-click="pagedata.list=[];pagedata.loaded=false;pagedata.params.page=1;pagedata.params.status=2;pagedata.get_list()">审核失败</a>
 </div>
		<div class="fui-tab fui-tab-warning" id="tab">
            <a ng-repeat="(area_type,title) in pagedata.area_types" ng-click="pagedata.list=[];pagedata.loaded=false;pagedata.params.page=1;pagedata.params.area_type=area_type;pagedata.get_list()" ng-class="{'active':pagedata.params.area_type==area_type}" href="javascript:;">{{title}}</a>
        </div>
        <div  class="fui-list-group" id="container" ng-init="pagedata.get_list()">
		<div ng-repeat="item in pagedata.list track by item.id" class="fui-list" style="height: 3.5rem">
			
			<div class="fui-list-inner">
				<div class="row">
				      <div class="row-text" >
					 
					 {{item.address}} 
					 
				      </div>
				</div>
				<div  class="subtitle">
					订单数：{{item.order_num}}
				    
				    
				</div>
				<div  class="subtitle">
				    区域分红:{{item.commission_money}}元
				</div>
			</div>

			
		</div>
		</div>
		<div class='infinite-loading' style="display:none" id="loading_show"><span class='fui-preloader'></span><span class='text'> 正在加载...</span></div>
		<div ng-if="pagedata.list.length==0" class='content-empty' >
			<!--<i class='icon icon-group'></i><br/>暂时没有任何数据-->
			<img src="../core/resource/images/nomeb.png" style="width: 6rem;margin-bottom: .5rem;"><br/><p style="color: #999;font-size: .75rem">暂时没有任何数据</p>
		</div>

    </div>
</div>
<script>
scope.pagedata.get_list=function(){
	if(scope.pagedata.loading || scope.pagedata.loaded){
		return;
	}
	scope.pagedata.loading=true;
	$('#loading_show').show();
	var query=scope.made_query(scope.pagedata.params);
	scope.get('//list/'+query,function(res){
		
		
		scope.pagedata.loading=false;
		$('#loading_show').hide();
		if(res=='none'){
			scope.pagedata.loaded=true;
			return;
		}
		if(!Array.isArray(res)){
			scope.message('获取数据失败！');
			return;
		}
		if(res.length<scope.pagedata.psize){
			scope.pagedata.loaded=true;
		}
		if(!scope.pagedata.list){
			scope.pagedata.list=[];
		}
		res.forEach(function(row){
			scope.pagedata.list.push(row);
		});
		scope.pagedata.params.page++;
		
	});
}
scope.pagedata.scroll_bottom=function(){
	scope.pagedata.get_list();
}
</script>

